package com.ruoyi.workstation.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.workstation.mapper.UserFirmwarePackageMapper;
import com.ruoyi.workstation.domain.UserFirmwarePackage;
import com.ruoyi.workstation.service.IUserFirmwarePackageService;
import com.ruoyi.common.core.text.Convert;

/**
 * 客户固件包管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-01-13
 */
@Service
public class UserFirmwarePackageServiceImpl implements IUserFirmwarePackageService 
{
    @Autowired
    private UserFirmwarePackageMapper userFirmwarePackageMapper;

    /**
     * 查询客户固件包管理
     * 
     * @param id 客户固件包管理主键
     * @return 客户固件包管理
     */
    @Override
    public UserFirmwarePackage selectUserFirmwarePackageById(Long id)
    {
        return userFirmwarePackageMapper.selectUserFirmwarePackageById(id);
    }

    @Override
    public UserFirmwarePackage check(int type) {
        return userFirmwarePackageMapper.check(type);
    }

    /**
     * 查询客户固件包管理列表
     * 
     * @param userFirmwarePackage 客户固件包管理
     * @return 客户固件包管理
     */
    @Override
    public List<UserFirmwarePackage> selectUserFirmwarePackageList(UserFirmwarePackage userFirmwarePackage)
    {
        return userFirmwarePackageMapper.selectUserFirmwarePackageList(userFirmwarePackage);
    }

    /**
     * 新增客户固件包管理
     * 
     * @param userFirmwarePackage 客户固件包管理
     * @return 结果
     */
    @Override
    public int insertUserFirmwarePackage(UserFirmwarePackage userFirmwarePackage)
    {
        userFirmwarePackage.setCreateTime(DateUtils.getNowDate());
        return userFirmwarePackageMapper.insertUserFirmwarePackage(userFirmwarePackage);
    }

    /**
     * 修改客户固件包管理
     * 
     * @param userFirmwarePackage 客户固件包管理
     * @return 结果
     */
    @Override
    public int updateUserFirmwarePackage(UserFirmwarePackage userFirmwarePackage)
    {
        return userFirmwarePackageMapper.updateUserFirmwarePackage(userFirmwarePackage);
    }

    /**
     * 批量删除客户固件包管理
     * 
     * @param ids 需要删除的客户固件包管理主键
     * @return 结果
     */
    @Override
    public int deleteUserFirmwarePackageByIds(String ids)
    {
        return userFirmwarePackageMapper.deleteUserFirmwarePackageByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除客户固件包管理信息
     * 
     * @param id 客户固件包管理主键
     * @return 结果
     */
    @Override
    public int deleteUserFirmwarePackageById(Long id)
    {
        return userFirmwarePackageMapper.deleteUserFirmwarePackageById(id);
    }
}
